$(function() {
	let banner = new Swiper('.banner .swiper-container', {
		autoplay: true,
		pagination: {
			el: '.swiper-pagination',
		}
	});
	let banner1 = new Swiper('.banner1 .swiper-container', {
		autoplay: true,
		pagination: {
			el: '.swiper-pagination',
		}
	});
	let join_swiper = new Swiper('.join_swiper .swiper-container', {
		autoplay: true,
		pagination: {
			el: '.swiper-pagination',
		}
	});
	let ifun_swiper = new Swiper('.ifun_swiper .swiper-container', {
		slidesPerView: 4,
		spaceBetween: 54,
		pagination: {
			el: '.swiper-pagination',
		},
	});
	$(".broadcast").slide({
		mainCell: ".bd ul",
		autoPage: true,
		effect: "top",
		autoPlay: true,
	});
	$(".ijoin").slide({
		mainCell: ".bd ul",
		autoPage: true,
		effect: "top",
		autoPlay: true,
	});
	$('.download').on('click',function() {
		$('.login').toggle();
		$('.zhezhao').toggle();
	});
	$('.close').on('click',function() {
		$('.popup').hide();
		$('.zhezhao').hide();
	});
	$('.zhezhao').on("click", function(e) {
		let target = $(e.target);
		if (target.closest(".popup").length == 0) {
			$('.popup').hide();
			$('.zhezhao').hide();
		}
	});
	$('.left').on('click',function(){
		window.history.go(-1);
	});
	$("form :checkbox").on('click', function() {
		$("button#submit").prop("disabled", !$(this).is(":checked"));
		$("button.clearfix").prop("disabled", !$(this).is(":checked"));
	});
	$('.radius').on('click',function(){
		$(this).next().toggleClass('on');
	});
	new hSdrop({
		els:'.sele-bp'
	});
	$('#dowebok').simplerSidebar({
	    opener: '#menu',
	    sidebar: {
	        align: 'right',
	        width: 200
	    }
	});
	
	$('.newsv .ico_box span').on('click',function(){
		$(this).toggleClass('on');
	});
	
	
	// $('button').on('click',function(){
	// 	console.log($(this).is(':disabled'));
		
	// 	console.log(111);
		
	// });
	// $('button').on('click',function(){
	// 	console.log(11);
	// });
	
	$("[data-fancybox]").fancybox({
		animationEffect: "fade",
	});

});

var pop=function(classname,msg){
	switch (classname){
		case 'loading':
			if(msg == true){
				$('.'+`${classname}`).fadeIn();
			}else{
				$('.'+`${classname}`).fadeOut();
			}
		break;
		case 'err':
			$('.err p').html(msg);
			settime(classname);
		break; 
		case 'succe':
			$('.succe p').html(msg);
			settime(classname);
		break; 
	}
};



var settime=function(classname){
	$('.'+`${classname}`).fadeIn();
	setTimeout(()=>{
		$('.'+`${classname}`).fadeOut();
	},3000);
};